import request from '@/utils/workshopRequest';
import { urlConfig } from '@/api/urlConfig';
import axios from 'axios';
const MES = {
  // 获取络筒分组数据
  queryGroupWenShiList: params => {
    const url = urlConfig.queryGroupWenShiList;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 获取络筒分组数据
  queryGroupLuoTongList: params => {
    const url = urlConfig.queryGroupLuoTongList;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 获取络筒分组数据
  queryGroupLuoTongList1: params => {
    const url = urlConfig.queryGroupLuoTongList1;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 获取并条分组数据
  queryGroupBingTiaoList: params => {
    const url = urlConfig.queryGroupBingTiaoList;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 获取梳棉机分组数据
  queryGroupShuMianJiList: params => {
    const url = urlConfig.queryGroupShuMianJiList;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 获取太行粗纱欧姆龙分组数据
  queryGroupTxcsomlList: params => {
    const url = urlConfig.queryGroupTxcsomlList;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 获取细纱分组数据
  queryGroupXiShaList: params => {
    const url = urlConfig.queryGroupXiShaList;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 获取多仓分组数据
  queryGroupDuoCangList: params => {
    const url = urlConfig.queryGroupDuoCangList;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 获取精开棉机分组数据
  queryGroupKaiMianList: params => {
    const url = urlConfig.queryGroupKaiMianList;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 获取抓棉机分组数据
  queryGroupZhuaMianList: params => {
    const url = urlConfig.queryGroupZhuaMianList;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 获取清花分组数据
  queryGroupQingHuaList: params => {
    const url = urlConfig.queryGroupQingHuaList;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  /**
   * 实时数据
   */
  // 络筒实时数据查询接口
  queryNewestLuoTong: params => {
    const url = urlConfig.queryNewestLuoTong;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 并条实时数据查询接口
  queryNewestBingTiao: params => {
    const url = urlConfig.queryNewestBingTiao;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 梳棉机1207实时数据查询接口
  queryNewestShuMianji: params => {
    const url = urlConfig.queryNewestShuMianji;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 梳棉机2017A实时数据查询接口
  queryNewestShuMianjiA: params => {
    const url = urlConfig.queryNewestShuMianjiA;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 太行粗纱欧姆龙实时数据查询接口
  queryNewestTxcsoml: params => {
    const url = urlConfig.queryNewestTxcsoml;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 新粗纱欧姆龙实时数据查询接口
  queryNewestCuShaji: params => {
    const url = urlConfig.queryNewestCuShaJi;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 细纱马佐里实时数据查询接口
  queryNewestXiShaMzl: params => {
    const url = urlConfig.queryNewestXiShaMzl;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 多仓实时数据查询接口
  queryNewestDuoCang: params => {
    const url = urlConfig.queryNewestDuoCang;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 精开棉实时数据查询接口
  queryNewestKaiMian: params => {
    const url = urlConfig.queryNewestKaiMian;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 抓棉实时数据查询接口
  queryNewestZhuaMian: params => {
    const url = urlConfig.queryNewestZhuaMian;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 动力柜实时数据查询接口
  queryNewestDongLi: params => {
    const url = urlConfig.queryNewestDongli;
    return new Promise((resolve, reject) => {
      request
        .post(url, params)
        .then(res => {
          resolve(res.data);
        })
        .catch(err => {
          reject(err);
        });
    });
  }
};
export default MES;
export { MES };
